layui.use(['table','jquery'],function(){
    var table=layui.table;
    var $=layui.jquery;
    var productId=localStorage.getItem('productId');
    /*获取审核信息*/
    $.ajax({
        url:'/goodsTable/getGoodsRecord',
        type:'post',
        dataType:'json',
        data:{'productId':productId},
        success:function(data){
            getDetailedTable(data.data);
        }
    });
    /*渲染表格*/
    function getDetailedTable(data){
        table.render({
            elem:'#table',
            data:data,
            title:'',
            cols:[[
                {field:'implementDate',title:'审核时间',align:'center'},
                {field:'trueName',title:'审核人员',align:'center'},
                {
                field:'result',title:'审核结果',align:'center',templet:function(data){
                    if(data.result==1){
                        data.result="审核通过";
                    }else if(data.result==2){
                     data.result="待审核";
                    }else if(data.result==3){
                        data.result="审核未通过";
                    }else{
                        data.result="审核错误";
                    }
                    return"<div>"+data.result+"</div>";
                }
                },
                {field:'remarks',title:'反馈详细',align:'center'},
            ]]
        });
    }
})